package com.glory.good_dark.application;

import android.app.Activity;
import android.widget.EditText;

import com.pda.platform.ui.ui_pdaplatform.base.FreeUI_BaseActivity;
import com.pda.platform.ui.ui_pdaplatform.entity.FreeUI_AddViewEntity;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_DialogUtils;


public abstract class BaseActivity extends FreeUI_BaseActivity {

    public interface editTextListener{
        void onTextChangeListener(String s);
    }
    @Override
    protected abstract int getLayoutResId();

    @Override
    protected abstract void initView();

    @Override
    protected abstract void initData();


    @Override
    protected abstract FreeUI_AddViewEntity getBaseEntity();

    protected boolean editIsEmpty(EditText et, String msg){
        if (et.getText().toString().trim().length() == 0) {
            showToast(msg, false);
            return false;
        } else {
            return true;
        }
    }



    protected void showConfirmDialog(Activity context, String message){
        FreeApi_DialogUtils.getConfirmDialog(this, "确定",message, () -> {
            context.finish();
        }).show(getSupportFragmentManager(),"CONFIRM_DIALOG");
    }

    protected void showConfirmDialog(String message){
        FreeApi_DialogUtils.getConfirmDialog(this, "确定",message, () -> {

        }).show(getSupportFragmentManager(),"CONFIRM_DIALOG");
    }
}
